<div id="component" class="wrapper wrapper-content animated fadeInRight ecommerce">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-title">
                    <h5><span><vc:i18n name="查询条件" namespace="purchaseApplyDetailManage"></vc:i18n></span></h5>
                    <div class="ibox-tools" style="top:10px;">
                        <button type="button" class="btn btn-link btn-sm" style="margin-right:10px;"
                                v-on:click="_moreCondition()">
                            {{purchaseApplyDetailManageInfo.moreCondition == true?'隐藏':'更多'}}
                        </button>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-3">
                            <div class="form-group">
                                <input type="text" :placeholder="vc.i18n('订单号','purchaseApplyDetailManage')"
                                       v-model="purchaseApplyDetailManageInfo.conditions.applyOrderId"
                                       class=" form-control">
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <select class="custom-select" v-model="purchaseApplyDetailManageInfo.conditions.state">
                                <option selected value="">{{vc.i18n('请选择状态','purchaseApplyDetailManage')}}</option>
                                <option v-for="(item,index) in purchaseApplyDetailManageInfo.states" :key="index"
                                        v-bind:value="item.statusCd">{{item.name}}
                                </option>
                            </select>
                        </div>
                        <div class="col-sm-3">
                            <div class="form-group">
                                <input type="text" :placeholder="vc.i18n('请填写申请人姓名','purchaseApplyDetailManage')"
                                       v-model="purchaseApplyDetailManageInfo.conditions.userName"
                                       class=" form-control">
                            </div>
                        </div>
                        <div class="col-sm-2">
                            <button type="button" class="btn btn-primary btn-sm"
                                    v-on:click="_queryInspectionPlanMethod()">
                                <i class="fa fa-search"></i> <span><vc:i18n name="查询" namespace="purchaseApplyDetailManage"></vc:i18n></span>
                            </button>
                            <button type="button" class="btn btn-primary btn-sm"
                                    v-on:click="_resetInspectionPlanMethod()">
                                <i class="fa fa-repeat"></i> <span><vc:i18n name="重置" namespace="purchaseApplyDetailManage"></vc:i18n></span>
                            </button>
                        </div>
                    </div>
                    <div class="row" v-show="purchaseApplyDetailManageInfo.moreCondition == true">
                        <div class="col-sm-3">
                            <div class="form-group">
                                <input type="text" :placeholder="vc.i18n('请填写使用人姓名','purchaseApplyDetailManage')" class="form-control"
                                       v-model="purchaseApplyDetailManageInfo.conditions.endUserName">
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <div class="form-group">
                                <input type="text" :placeholder="vc.i18n('请填写物品名称','purchaseApplyDetailManage')" class="form-control"
                                       v-model="purchaseApplyDetailManageInfo.conditions.resName">
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <select class="custom-select"
                                    v-model="purchaseApplyDetailManageInfo.conditions.warehousingWay">
                                <option selected value="">{{vc.i18n('请选择采购方式','purchaseApplyDetailManage')}}</option>
                                <option v-for="(item,index) in purchaseApplyDetailManageInfo.warehousingWays"
                                        :key="index"
                                        v-bind:value="item.statusCd">{{item.name}}
                                </option>
                            </select>
                        </div>
                    </div>
                    <div class="row" v-show="purchaseApplyDetailManageInfo.moreCondition == true">
                        <div class="col-sm-3">
                            <select class="custom-select"
                                    v-model="purchaseApplyDetailManageInfo.conditions.resOrderType">
                                <option selected value="">{{vc.i18n('请选择出入库方式','purchaseApplyDetailManage')}}</option>
                                <option v-for="(item,index) in purchaseApplyDetailManageInfo.resOrderTypes" :key="index"
                                        v-bind:value="item.statusCd">{{item.name}}
                                </option>
                            </select>
                        </div>
                        <div class="col-sm-4">
                            <div class="form-group input-group">
                                <input type="text" :placeholder="vc.i18n('请选择创建开始时间','purchaseApplyDetailManage')"
                                       v-model="purchaseApplyDetailManageInfo.conditions.startTime"
                                       class=" form-control startTime">
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <div class="form-group input-group">
                                <input type="text" :placeholder="vc.i18n('请选择创建结束时间','purchaseApplyDetailManage')"
                                       v-model="purchaseApplyDetailManageInfo.conditions.endTime"
                                       class=" form-control endTime">
                            </div>
                        </div>
                    </div>
                    <div class="row" v-show="purchaseApplyDetailManageInfo.moreCondition == true">
                        <div class="col-sm-3">
                            <div class="form-group">
                                <select class="custom-select" v-model="purchaseApplyDetailManageInfo.conditions.parentRstId" @change="_listResourceStoreSonTypes">
                                    <option selected value="">{{vc.i18n('请选择物品类型','purchaseApplyDetailManage')}}</option>
                                    <option v-for="(item,index) in purchaseApplyDetailManageInfo.resourceStoreTypes"
                                            :key="index"
                                            v-bind:value="item.rstId">
                                        {{item.name}}
                                    </option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <div class="input-group">
                                <select class="custom-select" v-model="purchaseApplyDetailManageInfo.conditions.rstId" @change="_listResourceStoreSpecifications">
                                    <option selected value="">{{vc.i18n('请选择二级分类','purchaseApplyDetailManage')}}</option>
                                    <option v-for="(item,index) in purchaseApplyDetailManageInfo.resourceStoreSonTypes" :key="index"
                                        v-bind:value="item.rstId">
                                        {{item.name}}
                                    </option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <div class="form-group">
                                <select class="custom-select" v-model="purchaseApplyDetailManageInfo.conditions.rssId">
                                    <option selected value="">{{vc.i18n('请选择物品规格','purchaseApplyDetailManage')}}</option>
                                    <option v-for="(item,index) in purchaseApplyDetailManageInfo.resourceStoreSpecifications"
                                            :key="index"
                                            v-bind:value="item.rssId">
                                        {{item.specName}}
                                    </option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="row" v-show="purchaseApplyDetailManageInfo.moreCondition == true">
                        <div class="col-sm-3">
                            <div class="form-group input-group">
                                <select class="custom-select" v-model="purchaseApplyDetailManageInfo.conditions.rsId">
                                    <option selected value="">{{vc.i18n('请选择供应商','purchaseApplyDetailManage')}}</option>
                                    <option v-for="(item,index) in purchaseApplyDetailManageInfo.resourceSuppliers"
                                            :key="index"
                                            :value="item.rsId">{{item.supplierName}}
                                    </option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <div class="form-group input-group">
                                <select class="custom-select" v-model="purchaseApplyDetailManageInfo.conditions.shId">
                                    <option selected value="">{{vc.i18n('请选择仓库','purchaseApplyDetailManage')}}</option>
                                    <option v-for="(item,index) in purchaseApplyDetailManageInfo.storehouses"
                                            :key="index" :value="item.shId">{{item.shName}}
                                    </option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5><span><vc:i18n name="出入库明细" namespace="purchaseApplyDetailManage"></vc:i18n></span></h5>
                    <div class="ibox-tools" style="top:10px;">
                        <button type="button" class="btn btn-primary btn-sm" v-on:click="_exportExcel()">
                            <i class="fa fa-plus"></i><span><vc:i18n name="导出" namespace="purchaseApplyDetailManage"></vc:i18n></span>
                        </button>
                    </div>
                </div>
                <div class="ibox-content">
                    <table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
                        <thead>
                        <tr>
                            <th class="text-center"><span><vc:i18n name="申请单号" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="申请人" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="使用人" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="出入库类型" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="物品类型" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="物品名称" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="物品规格" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="是否是固定物品" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="物品供应商" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="物品仓库" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="采购" namespace="purchaseApplyDetailManage"></vc:i18n></span>/出库方式</th>
                            <th class="text-center"><span><vc:i18n name="申请数量" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="采购" namespace="purchaseApplyDetailManage"></vc:i18n></span>/出库数量</th>
                            <th class="text-center"><span><vc:i18n name="采购价格" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="总价" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="申请备注" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="状态" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name="创建时间" namespace="purchaseApplyDetailManage"></vc:i18n></span></th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-for="purchaseApplyDetail in purchaseApplyDetailManageInfo.purchaseApplyDetails">
                            <td class="text-center">{{purchaseApplyDetail.applyOrderId}}</td>
                            <td class="text-center">{{purchaseApplyDetail.userName}}</td>
                            <td class="text-center">{{purchaseApplyDetail.endUserName}}</td>
                            <td class="text-center">{{purchaseApplyDetail.resOrderTypeName}}</td>
                            <td class="text-center">
                                {{purchaseApplyDetail.parentRstName}} > {{purchaseApplyDetail.rstName}}
                            </td>
                            <td class="text-center">{{purchaseApplyDetail.resName}}</td>
                            <td class="text-center">
                                {{purchaseApplyDetail.specName ? purchaseApplyDetail.specName : '-'}}
                            </td>
                            <td class="text-center">{{purchaseApplyDetail.isFixedName}}</td>
                            <td class="text-center">
                                {{purchaseApplyDetail.supplierName? purchaseApplyDetail.supplierName : '-'}}
                            </td>
                            <td class="text-center">{{purchaseApplyDetail.shName}}</td>
                            <td class="text-center">
                                {{purchaseApplyDetail.warehousingWayName}}{{purchaseApplyDetail.resOrderTypeName}}
                            </td>
                            <td class="text-center">{{purchaseApplyDetail.quantity}}{{purchaseApplyDetail.unitCodeName}}</td>
                            <td class="text-center">
                                {{purchaseApplyDetail.purchaseQuantity ? purchaseApplyDetail.purchaseQuantity+purchaseApplyDetail.unitCodeName : '-'}}
                            </td>
                            <td class="text-center">
                                ￥{{purchaseApplyDetail.price ? purchaseApplyDetail.price : '0.00'}}
                            </td>
                            <td class="text-center">
                                <!-- {{purchaseApplyDetail.resOrderType == '10000' ? '￥' +
                                purchaseApplyDetail.totalApplyPrice : '-'}} -->
                                {{purchaseApplyDetail.totalApplyPrice}}
                            </td>
                            <td class="text-center">{{purchaseApplyDetail.remark}}</td>
                            <td class="text-center">{{purchaseApplyDetail.stateName}}</td>
                            <td class="text-center">{{purchaseApplyDetail.createTime}}</td>
                        </tr>
                        </tbody>
                        <tfoot>
                        <tr>
                            <td colspan="18">
                                <ul class="pagination float-right"></ul>
                            </td>
                        </tr>
                        </tfoot>
                    </table>
                    <!-- 分页 -->
                    <vc:create path="frame/pagination"></vc:create>
                </div>
            </div>
        </div>
    </div>
    <vc:create path="common/viewImage"></vc:create>
</div>
